<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>逢10换行</title>
<style>
div {width:50px; height:50px; background:red; position:absolute; top:0; left:0;}
</style>
<script>
window.onload = function (){
	var aDiv = document.getElementsByTagName('div');
	var str = '';
	for (var i = 0; i < 4; i++) {
		for (var j = 0; j < 10; j++) {
   			str += '<div style="left:'+ 55*j + 'px; top:'+ 60*i +'px;">'+ i+j +'</div>';
  		};
	};	
  	
  	document.body.innerHTML = str;
 
}
</script>
</head>
<body>

</body>
</html>
